At present, in a data transmission scenario based on a communication protocol, for example, the MDIO MSA, data transmitted during reading and writing operations are not checked instantly. In communications, once an error occurs in data transmission, an inestimable result may be incurred. For example, an error occurs when a wavelength of a channel is set. When it is expected to set the wavelength of the channel as the fourth wave, it is possible to receive at the sixth wave because of interference during the transmission. As a result, there is no signal at the fourth wave after combining the waves, and a superposed signal is at the sixth wave, so that a receiver cannot receive effectively, which causes the service interruption for two signals.
In the process of implementing the technical solutions in the embodiments of the application, the inventor of the application finds at least the following technical problems in the conventional art.
In practical work, because there is not a handshake check mechanism during the MDIO communication, a packet error or packet loss often occurs. However, the host does not know and cannot correct in time.
FIG. 1 shows an MDIO command frame for the MDIO communication. A structure of an MDIO command frame is briefly described as follows.
A data frame structure defined by IEEE 802.3 is used for communications. The whole length of each frame is 64 bits, wherein the first 32 bits are for the preamble, and the last 32 bits are for the address frames or command frames. The 32-bit preamble is continuous 32 logic “1” bits which are sent to the optical module by the host. A state between the frames is idle.
The MDIO command frame is composed of the following 6 parts:                ST: start bit (2 bit);        OP: opcode (2 bit);        PHYADR: physical port address (5 bit), wherein an address value “0b00000” is a broadcast address;        DEVADD: MDIO device address;        TA: turn around code (2 bit); for the reading operation, the host and the optical module keep an MDIO data line as high impedance at the first bit of TA, the second bit of TA is set by the optical module as logic “0”, and the host starts to send data; for the writing operation, the host sets two bits of driving TA as “0b10”, and starts to perform a data writing operation on the optical module; and        16-bit address or data: a data payload field in the MDIO frame structure.        
A communication mode based on the MDIO includes the reading operation, the continuous reading operation and the writing operation.
To sum up, because there is not a check mechanism in communications, a transmission error occurring between the host and the optical module cannot be corrected in time. An effective solution has not been presented with respect to this problem yet.